#include "mainwindow.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}

// int main() {
//     std::string whisper_model_path = WHISPER_MODEL_PATH;
//     std::string vad_model_path     = VAD_MODEL_PATH;
//     std::string sample_path        = "C:/Users/yubo/Desktop/111.wav";

//     // Load the sample audio file
//     std::vector<float> pcmf32;
//     std::vector<std::vector<float>> pcmf32s;
//     assert(read_audio_data(sample_path, pcmf32, pcmf32s, false));
//     qInfo() << "pcmf32" << pcmf32.size();
//     struct whisper_context_params cparams = whisper_context_default_params();
//     struct whisper_context * wctx = whisper_init_from_file_with_params(
//             whisper_model_path.c_str(),
//             cparams);

//     struct whisper_full_params wparams = whisper_full_default_params(WHISPER_SAMPLING_BEAM_SEARCH);
//     wparams.vad            = true;
//     wparams.vad_model_path = vad_model_path.c_str();

//     wparams.vad_params.threshold               = 0.5f;
//     wparams.vad_params.min_speech_duration_ms  = 250;
//     wparams.vad_params.min_silence_duration_ms = 100;
//     wparams.vad_params.max_speech_duration_s   = FLT_MAX;
//     wparams.vad_params.speech_pad_ms           = 30;

//     assert(whisper_full_parallel(wctx, wparams, pcmf32.data(), pcmf32.size(), 1) == 0);

//     QString transcribedText;
//     int segments = whisper_full_n_segments(wctx);

//     for (int i = 0; i < segments; ++i) {
//         const char *text = whisper_full_get_segment_text(wctx, i);
//         transcribedText += QString::fromUtf8(text);
//     }
//     qInfo() << transcribedText;

//     whisper_free(wctx);

//     return 0;
// }
